package com.campus.counseling.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

@Data
@TableName("test_record")
public class TestRecord {
    
    @TableId(type = IdType.AUTO)
    private Long id;
    
    private Long testId;
    
    private Long userId;
    
    private LocalDateTime startTime;
    
    private LocalDateTime endTime;
    
    private Integer totalScore;
    
    private Integer status;
    
    @TableField(value = "answers", typeHandler = JacksonTypeHandler.class)
    private List<Map<String, Object>> answers;
    
    private LocalDateTime createTime;
    
    private LocalDateTime updateTime;
    
    @TableField(exist = false)
    private TestInfo test;
    
    @TableField(exist = false)
    private UserInfo user;
    
    @Data
    public static class TestInfo {
        private String title;
    }
    
    @Data
    public static class UserInfo {
        private String realName;
    }
} 